package b.o.a;

import b.f.i;
import b.i.b.f;
import b.n.g;
import b.n.l;
import b.n.m;
import b.n.p;
import b.n.q;
import b.n.r;
import b.n.s;
import com.huawei.hms.analytics.core.crypto.AesCipher.AesLen;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Objects;

/* compiled from: LoaderManagerImpl */
public class b extends a {
    public final g a;
    public final b b;

    /* compiled from: LoaderManagerImpl */
    public static class b extends p {
        public static final q c = new a();
        public i<a> b = new i(10);

        /* compiled from: LoaderManagerImpl */
        public static class a implements q {
            public <T extends p> T a(Class<T> cls) {
                return new b();
            }
        }

        public void a() {
            if (this.b.i() <= 0) {
                i iVar = this.b;
                int i = iVar.d;
                Object[] objArr = iVar.c;
                for (int i2 = 0; i2 < i; i2++) {
                    objArr[i2] = null;
                }
                iVar.d = 0;
                iVar.a = false;
                return;
            }
            Objects.requireNonNull((a) this.b.j(0));
            throw null;
        }
    }

    /* compiled from: LoaderManagerImpl */
    public static class a<D> extends l<D> {
        public void d() {
            throw null;
        }

        public void e() {
            throw null;
        }

        public void f(m<? super D> mVar) {
            super.f(mVar);
        }

        public void g(D d) {
            super.g(d);
        }

        public String toString() {
            StringBuilder stringBuilder = new StringBuilder(64);
            stringBuilder.append("LoaderInfo{");
            stringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
            stringBuilder.append(" #");
            stringBuilder.append(0);
            stringBuilder.append(" : ");
            f.D(null, stringBuilder);
            stringBuilder.append("}}");
            return stringBuilder.toString();
        }
    }

    public b(g gVar, s sVar) {
        this.a = gVar;
        q qVar = b.c;
        Class cls = b.class;
        String canonicalName = cls.getCanonicalName();
        if (canonicalName != null) {
            canonicalName = c.b.a.a.a.D("androidx.lifecycle.ViewModelProvider.DefaultKey:", canonicalName);
            p pVar = (p) sVar.a.get(canonicalName);
            if (!cls.isInstance(pVar)) {
                p a;
                if (qVar instanceof r) {
                    a = ((r) qVar).a(canonicalName, cls);
                } else {
                    a = ((a) qVar).a(cls);
                }
                pVar = a;
                a = (p) sVar.a.put(canonicalName, pVar);
                if (a != null) {
                    a.a();
                }
            }
            this.b = (b) pVar;
            return;
        }
        throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
    }

    @Deprecated
    public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        b bVar = this.b;
        if (bVar.b.i() > 0) {
            printWriter.print(str);
            printWriter.println("Loaders:");
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(str);
            stringBuilder.append("    ");
            String stringBuilder2 = stringBuilder.toString();
            if (bVar.b.i() > 0) {
                a aVar = (a) bVar.b.j(0);
                printWriter.print(str);
                printWriter.print("  #");
                printWriter.print(bVar.b.f(0));
                printWriter.print(": ");
                printWriter.println(aVar.toString());
                printWriter.print(stringBuilder2);
                printWriter.print("mId=");
                printWriter.print(0);
                printWriter.print(" mArgs=");
                printWriter.println(null);
                printWriter.print(stringBuilder2);
                printWriter.print("mLoader=");
                printWriter.println(null);
                throw null;
            }
        }
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder(AesLen.ROOTKEY_COMPONET_LEN);
        stringBuilder.append("LoaderManager{");
        stringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
        stringBuilder.append(" in ");
        f.D(this.a, stringBuilder);
        stringBuilder.append("}}");
        return stringBuilder.toString();
    }
}
